package cz.cvut.fel.gfupan.gui.execution;

import java.math.BigInteger;

public class Total implements Executable {

    private Executable f1;
    private Executable f2;

    public Total(Executable f1, Executable f2) {
        this.f1 = f1;
        this.f2 = f2;
    }

    @Override
    public String execute() {
        try {
            BigInteger f1big = new BigInteger(f1.execute());
            BigInteger f2big = new BigInteger(f2.execute());
            return f1big.subtract(f2big).toString();
        } catch (NumberFormatException e) {
        }
        return "";
    }
}